package CS2340.teamwatson.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
/**
 * This is the main page for the ToDoList Manager App. It consists of the user login page and buttons to go the
 * other pages after either login, register, or forgotten passsword actions.
 * 
 * @author Jasmin Muminhodzic
 * @version 1.0
 *
 */
public class mainLoginPage extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button next1 = (Button) findViewById(R.id.buttonLogin);
        Button next2 = (Button) findViewById(R.id.forgotPasswordButton);
        Button next3 = (Button) findViewById(R.id.createAccountButton);
          
        next1.setOnClickListener(onLoginPageClickListener);
        next2.setOnClickListener(onForgetPageClickListener);
        next3.setOnClickListener(onRegisterPageClickListener);
    }
    /**
     * this functions to get the forgotten password activity as the current screen
     */
    private OnClickListener onForgetPageClickListener = new OnClickListener() {
        @Override
        public void onClick(View v) {
        	Intent myIntent = new Intent(v.getContext(), forgotPasswordPage.class);
            startActivity(myIntent);
        }
    };
    
    /**
     * this functions to get the registration page activity as the current screen
     */
    private OnClickListener onRegisterPageClickListener = new OnClickListener() {
        @Override
        public void onClick(View v) {
        	Intent myIntent = new Intent(v.getContext(), registrationPage.class);
            startActivityForResult(myIntent, 1);
        }
    };
    
    
    /**
     * this functions to get the splash screen as the current screen, it will be set to whatever should happen
     * after clicks the login button after that is created.
     */
    private OnClickListener onLoginPageClickListener = new OnClickListener() {
        @Override
        public void onClick(View v) {
        	Intent myIntent = new Intent(v.getContext(), splashPage.class);
            startActivityForResult(myIntent, 3);
        }
    };
}


